<template>
  <div class="app-container">
    <h2 class="con-title">供应商信息</h2>
    <div class="content supplier-info" v-if="data">
      <table class=" sui-table table-bordered" style="width:900px">
        <thead>
          <tr>
            <th colspan="4">账户基础信息</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="left-td">供应商账号</td>
            <td colspan="3">{{data.uName}}</td>
          </tr>
          <tr>
            <td class="left-td">联系人</td>
            <td>{{data.contacts}}</td>
            <td class="left-td">联系方式</td>
            <td>{{data.phone}}</td>
          </tr>
          <tr>
            <td class="left-td">邮箱</td>
            <td>{{data.email}}</td>
            <td class="left-td">开通时间</td>
            <td>{{data.passTime|formatDate("yyyy-MM-dd hh:mm")}}</td>
          </tr>
        </tbody>
      </table>
      <table class=" sui-table table-bordered" style="width:900px">
        <thead>
          <tr>
            <th colspan="4">企业认证信息</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="left-td">企业名称</td>
            <td colspan="3">{{data.companyName}}</td>
          </tr>
          <tr>
            <td class="left-td">企业简介</td>
            <td colspan="3">{{data.companyIntro}}</td>
          </tr>

          <tr>
            <!--<td class="left-td">经营类型</td>
            <td>{{data.companyType}}</td>-->
            <td class="left-td">营业执照注册号</td>
            <td colspan="3">{{data.licenseNumber}}</td>
          </tr>

          <tr>
            <td class="left-td">企业经营地址</td>
            <td colspan="3">{{data.businessProvince}} {{data.businessCity}} {{data.businessArea}} {{data.businessAddress}}</td>
          </tr>

          <tr>

            <td class="left-td">营业执照图片</td>
            <td colspan="3"><img style="max-width:250px" :src="data.licenseImg" alt=""></td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</template>
<script>
  import {
    getSupplierInfo
  } from '@/api/user'
  export default {
    data() {
      return {
        data: null
      }
    },
    methods: {
      init() {
        // 获取供应商信息
        getSupplierInfo()
          .then(res => {
            this.data = res.data.supplierInfo
          }).catch(err => {
            console.log(err)
          })
      }
    },
    mounted() {
      this.init()
    }
  }

</script>
<style rel="stylesheet/scss" lang="scss">
  @import 'src/assets/css/sui.scss';
  .supplier-info {
    table {
      td.left-td {
        padding: 10px;
        width: 20%;
        text-align: right;
      }
    }
  }

</style>
